<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../css/ratchet.css"/>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"/>
    <!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<title>提交折线图数据</title>
</head>
<body>
<header class="bar bar-nav">
  <h1 class="title">提交折线图数据</h1>
</header>
    <div class="content">
        <form class="input-group" method="post" action="UpLine_1.php" id="f1">
    <?php
      error_reporting(0);
        // $link=mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS);
        $link=mysql_connect('localhost','root','root');
        if($link)
        {
            // mysql_select_db(SAE_MYSQL_DB,$link);
          mysql_select_db('ncqihang',$link);
            //your code goes here	
        }
   ?>
            <?php
                $sql_L ="SELECT * FROM HLine order by id asc";
                $result_L = mysql_query($sql_L)
                   or die(SQL语句执行失败);     
                while($row =mysql_fetch_row($result_L))
                    {	
                        echo    "<div class='input-row'>";
                        echo    "<label>数据".$row[0].":</label>";
                        echo    "<input type='text' name='sj".$row[0]."' placeholder='".$row[1]."' id='".$row[0]."' min='80' max='140'>";
                        echo    "</div>";           												
                    }
            ?>
  <br/>
  <br/>
  <br/>                     
                   
</form>       
</div>
<nav class="bar bar-tab">
  <a class="tab-item" href="#" onclick="randomdata()" >
    随机数据
  </a>
    <a class="tab-item" href="#" onclick="document.getElementById('f1').submit();">
    提交
  </a>
</nav>  
</body>
<script language="javascript">
	function randomdata(){
		var linedata=new Array(11);
			for(q=0;q<12;q++){
				linedata[q]=Math.round(Math.random()*300);
			}
			for(var v=0;v<12;v++){
				d=v+1;
				document.getElementById(d).value=linedata[v];
				}
		}
</script>
    <?php
        mysql_free_result($result_L);
        mysql_close();
     ?>
</html>
